package pecs210801;

import java.util.List;
import java.util.Stack;

public class MyStack<E> extends Stack<E> {
    public void pushAll(List<? extends E> fruits) {
        for (E fruit : fruits) {
            push(fruit);
        }
    }

    public void popAll(List<? super E> fruits) {
        while (!isEmpty()) {
            fruits.add(pop());
        }
    }
}
